<%@ page contentType="text/html;charset=UTF-8" language="java" pageEncoding="utf-8"%>
<%
    String path = request.getContextPath()+"/";
%>
<!DOCTYPE html>
<html><head>
    <base href="<%=path%>">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>卡王贷申请进度查询</title>

<meta name="viewport" content="maximum-scale=1.0,minimum-scale=1.0,user-scalable=0,width=device-width,initial-scale=1.0">
<meta name="format-detection" content="telephone=no,email=no,date=no,address=no">
    <link rel="stylesheet" type="text/css" href="static/progress/css/aui.2.0.css">
    <link rel="stylesheet" type="text/css" href="static/progress/css/style.css">
    <script type="text/javascript" src="static/progress/js/jquery-1.11.1.min.js"></script>
</head>
<style>
    .aui-width{width:40%;}
</style>
<body style="">
<div class="klqbg"><img src="static/progress/bg.jpg"></div>
<div class="klqinput2">
  <div class="klqtxt">卡王贷申请进度查询</div>
    <div class="aui-btn2 aui-btn-block3">
        <div class="aui-content">
            <ul class="aui-list aui-form-list">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label" style="color:#C00;">申请时间：</div>
                        <div class="aui-list-item-input" style="color:#C00;width:50%;" id="sqTime"></div>
                    </div>
                </li>
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-list-item-label" style="color:#C00;">状态：</div>
                        <div class="aui-list-item-input" style="color:#C00;width:50%;" id="state"></div>
                    </div>
                </li>
            </ul>
        </div>
    </div>
    <div class="aui-btn2 aui-btn-block3 aui-margin-t-15">
        <div class="aui-content">
            <ul class="aui-list aui-form-list">
                <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-col-xs-6 klqbold klqleft">分配时间</div>
                        <div class="aui-col-xs-6 klqbold klqleft">分配机构</div>
                    </div>
                </li>
            </ul>
            <ul class="aui-list aui-form-list content">
                <!-- <li class="aui-list-item">
                    <div class="aui-list-item-inner">
                        <div class="aui-col-xs-6 klqleft">2017/12/22</div>
                        <div class="aui-col-xs-6 klqleft">平安普惠</div>
                    </div>
                </li> -->
		        </ul>
        </div>
    </div>
    <!-- <div class="aui-btn3 aui-btn-block3 aui-margin-t-15 aui-margin-b-15"><a href="http://xjd.klqian.com/" style="color:#00dbfc; text-decoration:underline;">纯线上放款产品推荐，极速放款</a><br><a href="http://www.kuailaika.com/" style="color:#fdde36; text-decoration:underline;">推荐申请信用卡，增加个人信用</a></div> -->
</div>
<script>
function GetQueryString(name)
{
   var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
   var r = window.location.search.substr(1).match(reg);
   if(r!=null)return  unescape(r[2]); return null;
}
$(function () {
    var phone = GetQueryString("mobile");
    var data = {"mobile":phone}
    $.ajax({
        url:'user/progress',
        type:'post',
        data:data,
        dataTypt:'json',
        timeout:'1000',
        cache:'false',
        error: erryFunction,
        success: succFunction
    })
    function erryFunction() {
        alert("请求错误");
    }
    function timeStamp2String (time){
        var datetime = new Date();
        datetime.setTime(time);
        var year = datetime.getFullYear();
        var month = datetime.getMonth() + 1;
        var date = datetime.getDate();
        var hour = datetime.getHours();
        var minute = datetime.getMinutes();
        var second = datetime.getSeconds();
        var mseconds = datetime.getMilliseconds();
        return year + "-" + month + "-" + date;
    };
    function succFunction(tt) {
        // var jsData = JSON.parse(tt);
        var jsData = tt;
        if (jsData.code == 200){
            var data = jsData.data;
            // var unixTimestamp = new Date( data[0].createDate);
            var commonTime = timeStamp2String(data[0].createDate);
            // var commonTime = unixTimestamp.toLocaleString();
            $('#sqTime').text(commonTime);
            if(data.length>=2){
              $('#state').text("已分配");
              var html = '';
              for(var i=1;i<data.length;i++){
                // var unixTimestamp2 = new Date( data[i].createDate);
                var commonTime2 = timeStamp2String(data[i].createDate);
                  // html +='<li>' + '<p class="m0">' + 'NO.'+(i+1)+ '</p>' +
                  //         '提问人：' + data[i].name + '&nbsp;' + data[i].ask_time + '<br>'+
                  //         '内容：' + data[i].ask_content + '</li>';
                  html +='<li class="aui-list-item"><div class="aui-list-item-inner"><div class="aui-width klqleft">'+commonTime2+'</div><div class="aui-col-xs-6 klqleft">'+data[i].interfaceName+'</div></div></li>';
              }
              var oContent = $('.content');
              oContent.html(html);
            }else{
              $('#state').text("未分配");
            }
        }else {
            alert('响应错误');
        }
    }
});
</script>




</body></html>
